#!/usr/bin/env node
const axios = require('axios');
const commander = require('commander');
const inquirer = require('inquirer');

commander.command('star').action(() => {
    inquirer.prompt([{
        type:"input",
        message:"请输入星座",
        name: "star"
    }]).then(res=>{
        axios.get(`http://web.juhe.cn:8080/constellation/getAll?key=1e86cbe4ac7c8e1d23dcc5a133221f7b&type=today&consName=${encodeURIComponent(res.star)}`)
        .then(data=>{
            console.log('今日运势：',data.data.summary)
        })
    })
})
commander.parse(process.argv)